use std::path::PathBuf;
use clap::Parser;
use crate::{CmdExector, serve};

impl CmdExector for HttpSubcommand {
    async fn execute(self) -> anyhow::Result<()> {
        serve(self).await
    }
}

#[derive(Debug, Parser)]
pub enum HttpSubcommand {
    #[command(name = "serve")]
    Serve(HttpServeOpts),

}

#[derive(Debug, Parser)]
pub struct HttpServeOpts {
    #[arg(long, default_value = ".")]
    pub path: PathBuf,
    #[arg(long, default_value_t = 9999)]
    pub port: u16,

}
